Email PHP 

How to enable domain to send mail through PHP mail() script in CPanel

Yes! we faced this problem many times because previously in CPanel through PHP mail() function you could send mail within a domain. for example, using mail() script you could have sent mail from abc@getcodify.com to xyz@getcodify.com but now if your hosting company has enabled third-party mail delivery through PHP mail() script then you have to follow one simple step to send emails from your PHP mail script to third-party mail services like Gmail, Yahoo or outlook. After creating your email with your domain name you have to register the email which you want to use it in mail() script for sending transactional emails.

Follow the below steps:

1.Open Cpanel and check for the message as shown in below in image point 1. which tells “Attention! Please register your email IDs used in non-SMTP mails through CPanel plugin. Unregistered email IDs will not be allowed in non-smtp emails sent through scripts. Go to Mail section and find “Registered Mail IDs” plugin in paper_lantern theme.” this means you can register email/ if not also check in Email section whether you hosting enabled “Registered email ids” link as shown in below image point 3.

cpanel

If you don’t have the email of your domain to use in the script then create one by clicking on email accounts as shown in above image point 2. then follow the below image for creating an account.

creat new email id

Then go back to the main screen as in image 1 and click on Registered Email-Ids and add the email which you need to send email in the script. as shown in below image.

Also Read:  How to Create a Secure Login Script in PHP and MySQL

register email ids

In some cases, you have to wait for 30 minutes to 1 hour for activating. To check whether its active or not write a test script with PHP mail() function. as below.

<?php 

$msg="This is a test mail";
mail("youremail@example.com","My subject",$msg);
?>

 

Related posts